//package com.xin.springboot.config;
//
//import com.xin.springboot.component.LoginHandlerInterceptor;
//import com.xin.springboot.component.MyLocalResolver;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.servlet.LocaleResolver;
//import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
//
//@Configuration
//public class MyMvcConfig {
//    @Bean
//    public LocaleResolver localeResolver(){
//        return new MyLocalResolver();
//    }
//
//
//    @Bean //将组件注册在容器
//    public WebMvcConfigurerAdapter webMvcConfigurerAdapter(){
//        WebMvcConfigurerAdapter adapter = new WebMvcConfigurerAdapter() {
//
//            //注册拦截器
//            @Override
//            public void addInterceptors(InterceptorRegistry registry) {
//                //super.addInterceptors(registry);
//                //静态资源；  *.css , *.js
//                //SpringBoot已经做好了静态资源映射
//                registry.addInterceptor(new LoginHandlerInterceptor()).addPathPatterns("/**")
//                        .excludePathPatterns("/index.html","/","/login","/**/*.css","/label","/base64",
//                                "/**/*.js", "/**/*.png", "/**/*.jpg","/api/user","/register",
//                                "/**/*.jpeg", "/**/*.gif", "/**/*.css","/**/fonts/*,", "/**/*.map"
//                               );
//            }
//        };
//        return adapter;
//    }
//
//}
